import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import render from './a004';

/**
 * 列表 删除按钮
 */
import nodejs from '@feidao/web/atom/browser/msg/nodejs';

export default async function (fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	console.log(args[0].currentTarget.dataset);
	const t_no = args[0].currentTarget.dataset.feidaoTno;

	const query = [{ teacher_no: t_no }];
	console.warn(JSON.stringify(query));
	// 
	const res = await nodejs('flippedclass', 'usable-exam-teacher-del', query);
	if (res === 'success') {
		render(fd);
		console.log('------- delete -------');
	} else {
		alert('删除失败');
	}
}